<?php
use app\common\service\UrlService;
use app\common\service\StaticService;
use app\common\service\ConstantMapService;
StaticService::includeAppJsStatic( "/js/web/member/index.js",\app\assets\WebAsset::className() );
?>
<?php echo \Yii::$app->view->renderFile( "@app/modules/web/views/common/tab_member.php",[ 'current' => 'index' ] ); ?>
<div class="row">
            <div class="col-lg-12">
                <form class="form-inline wrap_search">
                    <div class="row  m-t p-w-m">
                        <div class="form-group">
                            <select name="status" class="form-control inline">
                                <option value="<?=ConstantMapService::$status_default;?>">请选择状态</option>
                                <?php foreach( $status_mapping as $_status => $_title ): ?>
                                <option value="<?=$_status;?>" <?php if( $_status == $search_conditions['status'] ): ?> selected <?php  endif; ?>  ><?=$_title?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text" name="mix_kw" placeholder="请输入关键字" class="form-control" value="<?=$search_conditions?$search_conditions['mix_kw']:''?>">
                                <span class="input-group-btn">
                            <button type="button" class="btn  btn-primary search">
                                <i class="fa fa-search"></i>搜索
                            </button>
                        </span>
                            </div>
                        </div>
                    </div>
                    <hr/>
                    <div class="row">
                        <div class="col-lg-12">
                            <a class="btn btn-w-m btn-outline btn-primary pull-right" href="/web/member/set">
                                <i class="fa fa-plus"></i>会员
                            </a>
                        </div>
                    </div>

                </form>
                <table class="table table-bordered m-t">
                    <thead>
                    <tr>
                        <th>头像</th>
                        <th>姓名</th>
                        <th>手机</th>
                        <th>性别</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if ( $member_list ): ?>
                        <?php foreach ( $member_list as $_item ): ?>
                    <tr>
                        <td><img alt="image" class="img-circle" src="<?=$_item['avatar']?>" style="width: 40px;height: 40px;"></td>
                        <td><?=$_item['nickname']?></td>
                        <td><?=$_item['mobile']?></td>
                        <td><?=$_item['sex_desc']?></td>
                        <td><?=$_item['status_desc']?></td>
                        <td>
                            <a  href="<?=UrlService::buildWebUrl( '/member/info',['id' => $_item['id']] );?>">
                                <i class="fa fa-eye fa-lg"></i>
                            </a>
                            <a class="m-l" href="<?=UrlService::buildWebUrl( '/member/set',[ 'id' => $_item['id'] ] )?>">
                                <i class="fa fa-edit fa-lg"></i>
                            </a>

                            <?php if( $_item['status_desc'] == "正常"  ): ?>
                                <a class="m-l remove" href="javascript:void(0);" data="<?=$_item['id'];?>">
                                    <i class="fa fa-trash fa-lg"></i>
                                </a>
                            <?php else:  ?>
                                <a class="m-l recover" href="javascript:void(0);" data="<?=$_item['id'];?>">
                                    <i class="fa fa-rotate-left fa-lg"></i>
                                </a>
                            <?php endif; ?>


                        </td>
                    </tr>
                            <?php endforeach; ?>
                    <?php endif; ?>

                    </tbody>
                </table>
        <?php echo \Yii::$app->view->renderFile( "@app/modules/web/views/common/pagination.php" ,[
                'pages' =>$pages,
                'url' => '/member/index'
        ]); ?>

            </div>
        </div>
